import Vue from 'vue'
import VueRouter from 'vue-router'
import store from '../store/index'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Index',
    component: () => import(/* webpackChunkName: "home" */ '../views/Index'),
    children: [
      //主页
      {
        path: '/',
        name: 'Home',
        component: () => import(/* webpackChunkName: "home" */ '../components/index/Home'),
      },
      //关于我们
      {
        path: 'aboutUs',
        name: 'AboutUs',
        component: () => import(/* webpackChunkName: "aboutUs" */ '../components/aboutUs/aboutUs'),
      },
      //全部商品
      {
        path: 'allShop',
        name: 'AllShop',
        component: () => import(/* webpackChunkName: "allShop" */ '../components/allShop/allShop'),
      },

      //详情页
      {
        path: 'particulars',
        name: 'particulars',
        component: () => import(/* webpackChunkName: "particulars" */ '../components/particulars/particulars'),
      },

      //报错页
      {
        path: 'ErrorModul',
        name: 'ErrorModul',
        component: () => import(/* webpackChunkName: "ErrorModul" */ '../components/ErrorModul'),
      },

      //收藏页
      {
        path: 'collect',
        name: 'Collect',
        component: () => import(/* webpackChunkName: "collect" */ '../components/collect/collect'),
      },
      //订单页
      {
        path: 'order',
        name: 'Order',
        component: () => import(/* webpackChunkName: "order" */ '../components/order/order'),
      },
      //购物车页
      {
        path: 'shoppingCart',
        name: 'ShoppingCart',
        component: () => import(/* webpackChunkName: "shoppingCart" */ '../components/shoppingCart/shoppingCart'),
      },
      //提交信息页
      {
        path: 'addOrder',
        name: 'AddOrder',
        component: () => import(/* webpackChunkName: "order" */ '../components/order/addOrder'),
      }
    ]
  },

]

const router = new VueRouter({
  routes
})

export default router